package com.ethan.autoclose;

import java.io.*;
import java.net.URLDecoder;

/**
 * @Description:
 * @Author ethan
 * @CreateDate: 2022/05/29 上午7:59
 * @UpdateDate: 2022/05/29 上午7:59
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args)  {
        String path = Test.class.getClassLoader().getResource("1.txt").getPath();
        try(BufferedReader bufferedReader = new BufferedReader(new FileReader(URLDecoder.decode(path, "UTF-8")));){
             String tmp =  bufferedReader.readLine();
            System.out.println(tmp);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
